class ToolType:
    (LatheTool, MillingTool) = range(2)

def getToolType(toolTypeStr):
    if toolTypeStr == "lathetool": return ToolType.LatheTool
    elif toolTypeStr == "millingtool": return ToolType.MillingTool

def getToolTypeStr(toolType):
    if toolType == ToolType.LatheTool: return "lathetool"
    elif toolType == ToolType.MillingTool: return "millingtool"

#####################################################################

class ToolMaterial:
    (HighSpeedSteel,Carbide) = range(2)

def getToolMaterial(toolMaterialStr):
    if toolMaterialStr == "hss": return ToolMaterial.HighSpeedSteel
    elif toolMaterialStr == "carbide": return ToolMaterial.Carbide

def getToolMaterialStr(toolMaterial):
    if toolMaterial == ToolMaterial.HighSpeedSteel: return "hss"
    elif toolMaterial == ToolMaterial.Carbide: return "carbide"

#####################################################################

class LatheTool:
    def __init__(self):
        name = "Default"
        material = ToolMaterial.HighSpeedSteel
        toolType = ToolType.LatheTool
        cutterType = 0
        orientation = 0
        frontAngle = 0
        backAngle = 0
        toolAngle = 0
        tipRadius = 0
        toolIndex = -1

    def getName(self): return self.name
    def setName(self, newName): self.name = newName

    def getMaterial(self): return self.material
    def setMaterial(self, material): self.material = material

    def getToolType(self): return self.toolType
    def setToolType(self, toolType): self.toolType = toolType

    def getCutterType(self): return self.cutterType
    def setCutterType(self, cutterType): self.cutterType = cutterType

    def getOrientation(self): return self.orientation
    def setOrientation(self, orientation): self.orientation = orientation

    def getFrontAngle(self): return self.frontAngle
    def setFrontAngle(self, frontAngle): self.frontAngle = frontAngle

    def getBackAngle(self): return self.backAngle
    def setBackAngle(self, backAngle): self.backAngle = backAngle

    def getToolAngle(self): return self.toolAngle
    def setToolAngle(self, toolAngle): self.toolAngle = toolAngle

    def getTipRadius(self): return self.tipRadius
    def setTipRadius(self, tipRadius): self.tipRadius = tipRadius

    def getToolIndex(self): return self.toolIndex
    def setToolIndex(self, toolIndex): self.toolIndex = toolIndex

class MillingTool:
    def __init__(self):
        self.name = "Default"
        self.material = ToolMaterial.HighSpeedSteel
        self.toolType = ToolType.MillingTool
        self.cutterType = 0
        self.diameter = 0
        self.lengthOffset = 0
        self.cuttingLength = 0
        self.cuttingAngle = 90
        self.helixAngle = 0
        self.cornerRadius = 0
        self.flatRadius = 0
        self.flutes = 0
        self.centerCutting = False
        self.toolIndex = -1

    def getName(self): return self.name
    def setName(self, name): self.name = name

    def getMaterial(self): return self.material
    def setMaterial(self, material): self.material = material

    def getToolType(self): return self.toolType
    def setToolType(self, toolType): self.toolType = toolType

    def getCutterType(self): return self.cutterType
    def setCutterType(self, cutterType): self.cutterType = cutterType

    def getDiameter(self): return self.diameter
    def setDiameter(self, diameter): self.diameter = diameter

    def getLengthOffset(self): return self.lengthOffset
    def setLengthOffset(self, lengthOffset): self.lengthOffset = lengthOffset

    def getCuttingLength(self): return self.cuttingLength
    def setCuttingLength(self, cuttingLength): self.cuttingLength = cuttingLength

    def getCuttingAngle(self): return self.cuttingAngle
    def setCuttingAngle(self, cuttingAngle): self.cuttingAngle = cuttingAngle

    def getHelixAngle(self): return self.helixAngle
    def setHelixAngle(self, helixAngle): self.helixAngle = helixAngle

    def getCornerRadius(self): return self.cornerRadius
    def setCornerRadius(self, cornerRadius): self.cornerRadius = cornerRadius

    def getFlatRadius(self): return self.flatRadius
    def setFlatRadius(self, flatRadius): self.flatRadius = flatRadius

    def getFlutes(self): return self.flutes
    def setFlutes(self, flutes): self.flutes = flutes

    def getCenterCutting(self): return self.centerCutting
    def setCenterCutting(self, centerCutting): self.centerCutting = centerCutting

    def getToolIndex(self): return self.toolIndex
    def setToolIndex(self, toolIndex): self.toolIndex = toolIndex


